package com.mzj.saas.mservice.application.controller;

import com.mzj.saas.commons.ResultBean;
import com.mzj.saas.mservice.application.service.AppRoverSetService;
import com.mzj.saas.mservice.application.vo.ApprovalProcessUserVO;
import com.mzj.saas.mservice.application.vo.UpdateAppRoverStatusVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/*
 *审批人设置
 */
@Controller
@RequestMapping("/appRover")
public class AppRoverSetController {
    @Autowired
    private AppRoverSetService appRoverSetService;

    /**
     * 资格审批人列表,实现了资格审批人列表的显示
     * @param accessToken 权限鉴定
     * @param pageNumber 当前页
     * @param pageSize 页数
     * @return
     */
    @PostMapping(value = "qualificationExaminerListShow")
    @ResponseBody
    public ResultBean<Object> qualificationExaminerListShow(@RequestHeader String accessToken, @RequestParam(defaultValue = "0") Integer pageNumber,
                                                            @RequestParam(defaultValue = "10") Integer pageSize) {
        return appRoverSetService.qualificationExaminerListShow(accessToken, pageNumber, pageSize);
    }

    /**
     * 信息备案确定人列表,实现了信息备案确定人列表的显示
     * @param accessToken 权限鉴定
     * @param pageNumber 当前页
     * @param pageSize 页数
     * @return
     */
    @PostMapping(value = "informationDeterminerListShow")
    @ResponseBody
    public ResultBean<Object> informationDeterminerListShow(@RequestHeader String accessToken, @RequestParam(defaultValue = "0") Integer pageNumber,
                                                            @RequestParam(defaultValue = "10") Integer pageSize) {
        return appRoverSetService.informationDeterminerListShow(accessToken, pageNumber, pageSize);
    }

    /**
     * 公租房绑定审批人列表,实现了公租房绑定审批人列表的显示
     * @param accessToken 权限鉴定
     * @param pageNumber 当前页
     * @param pageSize 页数
     * @return
     */
    @PostMapping(value = "bindingApproveListShow")
    @ResponseBody
    public ResultBean<Object> bindingApproveListShow(@RequestHeader String accessToken, @RequestParam(defaultValue = "0") Integer pageNumber,
                                                     @RequestParam(defaultValue = "10") Integer pageSize) {
        return appRoverSetService.bindingApproveListShow(accessToken, pageNumber, pageSize);
    }

    /**
     * 审批人设置-设置公租房绑定审批人
     * @param accessToken 权限鉴定
     * @param userId 审批人userId
     * @param orgId 当前社区节点OrgId
     * @return
     */
    @PostMapping(value = "appRoverSetHouseBindingAuditingPeople")
    @ResponseBody
    public ResultBean<Object> appRoverSetHouseBindingAuditingPeople(@RequestHeader String accessToken, @RequestParam(name = "userId", required = false) String userId, @RequestParam(name = "orgId", required = false) Long orgId) {
        return appRoverSetService.appRoverSetHouseBindingAuditingPeople(accessToken, userId, orgId);
    }

    /**
     * 审批人设置-设置 公租房资格审批人
     * @param accessToken 权限鉴定
     * @param approvalProcessUserVO
     * @return
     */
    @PostMapping(value = "appRoverSetQualificationExaminer")
    @ResponseBody
    public ResultBean<Object> appRoverSetQualificationExaminer(@RequestHeader String accessToken, @RequestBody ApprovalProcessUserVO approvalProcessUserVO) {
        return appRoverSetService.appRoverSetQualificationExaminer(accessToken, approvalProcessUserVO);
    }

    /**
     * 审批人设置-设置信息备案确定人
     * @param accessToken 权限鉴定
     * @param userId 确认人userId
     * @param orgId 社区节点orgId
     * @return
     */
    @PostMapping(value = "appRoverSetConfirmPeople")
    @ResponseBody
    public ResultBean<Object> appRoverSetConfirmPeople(@RequestHeader String accessToken, @RequestParam(name = "userId", required = false) String userId, @RequestParam(name = "orgId", required = false) Long orgId) {
        return appRoverSetService.appRoverSetConfirmPeople(accessToken, userId, orgId);
    }

    /*
     *资格审批人/确定人/绑定审批人状态修改
     */
    @PostMapping(value = "appRoverStatusSet")
    @ResponseBody
    public ResultBean<Object> appRoverStatusSet(@RequestHeader String accessToken, @RequestBody UpdateAppRoverStatusVO updateAppRoverStatusVO) {
        return appRoverSetService.appRoverStatusSet(accessToken, updateAppRoverStatusVO);
    }

}
